package ee.videorentalstore.protocols;

import ee.videorentalstore.protocols.types.CustomerProtocol;
import ee.videorentalstore.protocols.types.FilmManagerProtocol;
import ee.videorentalstore.users.User;
import ee.videorentalstore.users.types.Customer;
import ee.videorentalstore.users.types.FilmInventoryManager;

public class ProtocolFinder 
{
	public static Protocol getProtocolByUserType(User user)
	{
		if (user instanceof Customer)
		{
			return new CustomerProtocol();
		}
		else if (user instanceof FilmInventoryManager)
		{
			return new FilmManagerProtocol();
		}
		else
		{
			return new FilmManagerProtocol();
		}
	}
}
